

export default class InputListenerMgr<T>{
    protected listeners: T[] = []

    on(listener: T) {
        this.listeners.push(listener)
    }

    off(listener: T) {
        let index = this.listeners.indexOf(listener)
        if (index >= 0) {
            this.listeners.splice(index, 1)
        }
    }

    get length() {
        return this.listeners.length;
    }

    get list() {
        return this.listeners;
    }

}